// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import {Progress ,Overlay ,DatetimePicker,loading,Tab, Tabs ,Sticky,Panel,ImagePreview ,Image ,Uploader ,DropdownMenu,DropdownItem,Search,SwitchCell,Popup,RadioGroup,Radio,Grid, GridItem,Tabbar, TabbarItem,NavBar,Button,Field, Cell, CellGroup } from 'vant'
import Mui from 'vue-awesome-mui'
Vue.use(Mui)



// 引入echarts
import echarts from 'echarts'

import axios from 'axios'
axios.defaults.withCredentials = true
axios.defaults.baseURL = 'http://121.41.32.143:8080/JQ-DCP/'
//axios.defaults.headers.post['Content-Type'] = 'application/json';

;(function(){
	setInterval(()=>{
		let loginInfo = JSON.parse(localStorage.cksLoginInfo)
		if(loginInfo.id){
			axios.post(url.login,{id:loginInfo.id,password:loginInfo.password})
		}
	},600000)
})()

//axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';


Vue.prototype.$axios = axios
/* import service from '@/http.js'

Vue.prototype.$axios = service */

//允许发送cookie
//axios.defaults.withCredentials = true
//axios.defaults.baseURL = '/api'
//axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

//引入请求路径url
let url = require('@/serviceAPI')
Vue.prototype.url = url



Vue.prototype.$echarts = echarts

Vue.use(Progress ).use(Overlay ).use(DatetimePicker).use(loading ).use(Tabs).use(Tab).use(Sticky).use(Panel).use(ImagePreview).use(Image).use(Uploader).use(DropdownItem).use(DropdownMenu).use(Search).use(SwitchCell).use(Popup).use(Radio).use(RadioGroup).use(GridItem).use(Grid).use(TabbarItem).use(Tabbar).use(NavBar).use(CellGroup).use(Cell).use(Button).use(Field)

Vue.config.productionTip = false

Vue.prototype.goBack = function(){
	this.$router.go(-1)
}

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App},
  template: '<App/>'
})
